<?php
	class Resultat{
		private $id;
		private $idRefEleve;
		private $idRefReponse;
		private $idRefTest;
		private $temps;
		private $traite;
		
		public function __construct(){
			if(func_num_args() == 1)
			$this->hydrate(func_get_arg(0));		
		}
		
		public function hydrate(array $donnees){
			foreach ($donnees as $key => $value){
				$method = 'set'.ucfirst($key);
				if (method_exists($this, $method)){
					$this->$method($value);
				}
			}
		}
				
		// GETTERS
		public function id(){return $this->id;}
		public function idRefEleve(){return $this->idRefEleve;}
		public function idRefReponse(){return $this->idRefReponse;}
		public function idRefTest(){return $this->idRefTest;}
		public function temps(){return $this->temps;}
		public function traite(){return $this->traite;}

		// SETTERS
		public function setId($newId){$this->id = $newId;}
		public function setIdRefEleve($newIdRefEleve){$this->idRefEleve = $newIdRefEleve;}
		public function setIdRefReponse($newIdRefReponse){$this->idRefReponse = $newIdRefReponse;}
		public function setIdRefTest($newIdRefTest){$this->idRefTest = $newIdRefTest;}
		public function setTemps($newTemps){$this->temps = $newTemps;}
		public function setTraite($newTraite){$this->traite = $newTraite;}
	}
?>